﻿@model Aga.GestionDeArchivos.Web.Models.BaseModel

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/internal.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/start/jquery-ui-1.8.9.custom.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.9.custom.min.js")" type="text/javascript"></script>
    
    @if (IsSectionDefined("Scripts"))
    {
        @RenderSection("Scripts", false)
    }
    

    <script type="text/javascript">
        $(document).ready(function () {

            $("input:submit", ".buttons").button();
            $("a", ".addNew").button();
            $("a", ".buttons", ".imprimir").button();
            $("input:text").width(250);
            $('input[type="text"][class~="smalltext"]').width(50);
            $('input[type="text"][class~="mediumtext"]').width(100);
            $('input[type="text"][class~="text115"]').width(115);
            $('input[type="text"][class~="text425"]').width(425);
            $('input[type="text"][class~="largetext"]').width(500);
            $('input[type="text"][class~="extralargetext"]').width(690);
            $("input:password").width(250);
            $("textarea").width(500);


            //scroll the message box to the top offset of browser's scrool bar
            $(window).scroll(function () {
                $('.mensajeOk').animate({ top: $(window).scrollTop() + "px" }, { queue: false, duration: 350 });
                $('.mensajeError').animate({ top: $(window).scrollTop() + "px" }, { queue: false, duration: 350 });
            });
            //when the close button at right corner of the message box is clicked 
            $('#close_message').click(function () {
                //the messagebox gets scrool down with top property and gets hidden with zero opacity 
                $('.mensajeOk').animate({ top: "+=15px", opacity: 0 }, "slow");
                $('.mensajeError').animate({ top: "+=15px", opacity: 0 }, "slow");
            });
        });

        function showSubMenu(name) {
            $('div#sidebar').each(function () {
                $(this).hide();
            });

            $('#sidebar[name="' + name + '"]').show();

            $('li#mainmenu').each(function () {
                $(this).removeClass('active');
            });

            $('#mainmenu[name="' + name + '"]').attr('class', 'active');
        }

        $("input, textarea").focus( function () {
                // only select if the text has not changed
                if (this.value == this.defaultValue) {
                    this.select();
                }
            }
        );

        $("input:text:enabled:first").focus();
        $("input:text:enabled:first").select();

    </script>
    
</head>
<body>
    <a name="top"></a>
    <div id="header-bg-2">
        <div id="header-2" class="container">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td rowspan="2">
                        <h1>
                            AGA <span>Soluciones de Archivos</span></h1>
                    </td>
                    <td id="login">
                        <div id="logindisplay">
                            @Html.Partial("_LogOnPartial")
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div id="menu-bg">
        <div id="menu" class="container">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <ul>
                            @foreach (var menuItem in ViewBag.MainMenu)
                            {
                                <li id="mainmenu" class="@(ViewBag.Menu.Equals(menuItem.Key) ? "active" : "inactive")" name="@menuItem.Key"><a href="@menuItem.Url" accesskey="1" title="">@menuItem.Name</a>
                                </li>
                            }
                        </ul>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div id="page-bg">
        <div id="page-bgtop">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="container"
                id="page">
                <tr>
                    <td>
                        <!-- Side Menu -->
                        @Html.Partial("_SideBarMenu")
                        <!-- Content -->
                        @RenderBody()
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="container"
        id="footer">
        <tr>
            <td valign="top">
                <p>
                    Copyright (c) 2011 - AGA Soluciones de Archivos SA. - Quilmes, Buenos Aires, Argentina
                    - (11) 5274.2222</p>
            </td>
        </tr>
    </table>
    @if (Model != null && !String.IsNullOrEmpty(Model.LastStatus))
    {
        <div class="@(Model.LastStatus == "OK" ? "mensajeOk" : "mensajeError")">
        <img id="close_message" style="float:right;cursor:pointer;"  src="@Url.Content("~/Content/images/12-em-cross.png")" alt="@Model.Message" />
        @Model.Message</div>
    }
    
    <div style="display:block">
        @if (Model != null && Model.UseSounds && Model.LastStatus == "OK") 
        {
            @*@:<embed src="@Url.Content("~/Content/sounds/beep-ok.wav")" autostart="true" width="0" height="0" loop="false" hidden="true" id="ok" enablejavascript="true" />*@
            @*@:<BGSOUND SRC="@Url.Content("~/Content/sounds/beep-ok.wav")" LOOP=1>*@
            <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="1" width="1">
                <param name="src" value="@Url.Content("~/Content/sounds/beep-ok.wav")">
                <param name="autoplay" value="true">
                <param name="controller" value="false">
                <embed height="1" width="1" src="@Url.Content("~/Content/sounds/beep-ok.wav")" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" controller="false" autoplay="true">
            </object>
            }
        @if (Model != null && Model.UseSounds && Model.LastStatus == "ERROR")
        {
            @*@:<embed src="@Url.Content("~/Content/sounds/beep-error.wav")" autostart="true" width="0" height="0" loop="false" hidden="true" id="error" enablejavascript="true" />*@
            @*@:<BGSOUND SRC="@Url.Content("~/Content/sounds/beep-error.wav")" LOOP=1>*@
            <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="1" width="1">
                <param name="src" value="@Url.Content("~/Content/sounds/beep-error.wav")">
                <param name="autoplay" value="true">
                <param name="controller" value="false">
                <embed height="1" width="1" src="@Url.Content("~/Content/sounds/beep-error.wav")" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" controller="false" autoplay="true">
            </object>        
        }
        
        <script type="text/javascript">

            $("input:text:enabled:first").focus();

        </script>
</div>
  </body>
</html>
